<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"  prefix="fmt" %>
<%@ taglib uri="struts-html"                   prefix="html" %>
<%@ taglib uri="struts-tiles"                  prefix="tiles" %>
<%--
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
--%>
<fmt:setBundle basename="ApplicationResources" />

<script language="JavaScript" src="scripts/date-picker.js"></script>
<%-- 
<logic:messagesPresent message="true">
  <html:messages id="msg" message="true">
      <bean:write name="msg"/> <br/>
  </html:messages>
</logic:messagesPresent>
--%>
<!-- ##############################################################
     WORKSHOP 08 INSTRUCTIONS
     Display the validation errors, if any
     ############################################################## -->


<html:errors/>

<!-- Initialize the form URL variable. 
     This is read from the FORM_SUBMIT_URL which is set by the Action in the request
     If it is not set, we default to submitting a new application
 --> 
<c:set var="FORM_SUBMIT_URL" scope="page">
    <c:out value="${requestScope.FORM_SUBMIT_URL}"
           default="/protected/courseSubmit.do" />
</c:set>

<html:form action="<%= pageContext.getAttribute("FORM_SUBMIT_URL").toString() %>">

<table>
    <html:hidden property="courseId" />
    <html:hidden property="employeeId" />

    <tr>
    <td><fmt:message key="fieldLabel.courseName"/></td>
    <td colspan="3">
            <html:text size="40" property="courseName" />
    </td>
    </tr>
    <tr>
    <td><fmt:message key="fieldLabel.organiser"/></td>
    <td colspan="3">
            <html:text size="40" property="organiser" />
        </td>
    </tr>
    <tr>
    <td><fmt:message key="fieldLabel.startDate"/></td><td>
            <html:text size="16" property="fromDate" />
        <a href="javascript:show_calendar('courseForm.fromDate');" onmouseover="window.status='Date Picker';return true;" onmouseout="window.status='';return true;"><img src="img/show-calendar.gif" width=24 height=22 border=0></a>
        </td>
    <td><fmt:message key="fieldLabel.endDate"/></td><td>
            <html:text size="16" property="toDate" />
        <a href="javascript:show_calendar('courseForm.toDate');" onmouseover="window.status='Date Picker';return true;" onmouseout="window.status='';return true;"><img src="img/show-calendar.gif" width=24 height=22 border=0></a>
        </td>
    </tr>
    <tr>
    <td><fmt:message key="fieldLabel.fees"/></td>
    <td>
            <html:text size="20" property="fees" />
    </td>
    <td><fmt:message key="fieldLabel.gstIncluded"/></td>
    <td>
        <html:checkbox property="gstIncluded"/> 
    </td>
    </tr>
    <tr>
        <td><fmt:message key="fieldLabel.justification"/></td>
        <td colspan="3">
            <html:textarea cols="64" rows="5" property="justification"/>
        </td>
    </tr>
    <tr>
        <td><fmt:message key="fieldLabel.status"/></td>
        <td><html:text disabled="true" size="20" property="status"/></td>
    </tr>

    <tr>
        <td>&nbsp;</td>
        <td colspan="2" align="left"><br></br>
            <button type="submit">
                <img src="img/button_submit.gif" alt="" align="middle">
            </button>&nbsp;
            <a href="javascript:history.back();">
                <img src="img/button_cancel.gif" alt="" align="absmiddle" border="0">
            </a>
        </td>
    </tr>

</table>

</html:form>